from time import sleep

from selenium import webdriver
from selenium.webdriver import Keys, ActionChains
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('http://192.168.20.244/ecshop/admin/privilege.php?act=login')
driver.maximize_window()

#driver.find_element(By.NAME,'username').send_keys('caichang')

#driver.find_element(By.NAME,'username').send_keys(Keys.CONTROL,'v')
driver.find_element(By.NAME,'username').send_keys('caichang')
driver.find_element(By.NAME,'password').send_keys('caichang',Keys.NUMPAD1)
driver.find_element(By.ID,'tijiao').send_keys(Keys.ENTER)

sleep(2)


#鼠标
driver.switch_to.frame('header-frame')
actionChain = ActionChains(driver)
actionChain.move_to_element(driver.find_element(By.LINK_TEXT,'个人设置')).perform()
driver.find_element(By.LINK_TEXT,'退出').click()


